import request from '@/config/axios'

// 客户公司 VO
export interface CompanyVO {
  id: number // 主键
  fullName: string // 全称
  companyName: string // 简称
}

// 客户公司 API
export const CompanyApi = {
  // 查询客户公司分页
  getCompanyPage: async (params: any) => {
    return await request.get({ url: `/business/company/page`, params })
  },

  getCompanyList:async (params: any) => {
    return await request.get({ url: `/business/company/list`, params })
  },

  // 查询客户公司详情
  getCompany: async (id: number) => {
    return await request.get({ url: `/business/company/get?id=` + id })
  },

  // 新增客户公司
  createCompany: async (data: CompanyVO) => {
    return await request.post({ url: `/business/company/create`, data })
  },

  // 修改客户公司
  updateCompany: async (data: CompanyVO) => {
    return await request.put({ url: `/business/company/update`, data })
  },

  // 删除客户公司
  deleteCompany: async (id: number) => {
    return await request.delete({ url: `/business/company/delete?id=` + id })
  },

  // 导出客户公司 Excel
  exportCompany: async (params) => {
    return await request.download({ url: `/business/company/export-excel`, params })
  },
}
